package com.kb.erp.mapper.pg;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kb.erp.entity.pcbout.Issuance;
import com.kb.erp.entity.pcbout.UserWorkShop;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
@DS("pg-material")
public interface UserWorkShopMapper extends BaseMapper<UserWorkShop> {



    @Insert({
            "<script>",
            "INSERT INTO user_workshop (user_code, workshop_code, workshop_name, user_name) VALUES ",
            "<foreach collection='list' item='item' index='index' separator=','>",
            "(#{item.userCode}, #{item.workshopCode}, #{item.workshopName}, #{item.userName})",
            "</foreach>",
            "</script>"
    })
    void insertBatch(@Param("list") List<UserWorkShop> userWorkshops);
}
